<?php
class tbl_log_dau extends AppModel
{
    public $useTable = 'tbl_log_dau';
    public $useDbConfig = 'log_db';

    public function get_dau($_date)
    {
        $params = array(
            'fields' => array('date', 'dau'),
            'conditions' => array(
                'DATE(date)' => $_date
            ),
        );
        $data = $this->find('first', $params);

        if(empty($data))
        {
            return 0;
        }

        return $data['tbl_log_dau']['dau'];
    }
}